package com.oschina.service.impl;

import com.oschina.dao.album.AlbumDao;
import com.oschina.model.po.album.Album;
import com.oschina.service.inter.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by IntelliJ IDEA.
 * User:  valjean
 * Date:  2016/2/1
 * Time:  11:04
 * To change this template use File | Settings | File Templates.
 */
@Service
public class AlbumServiceImpl implements AlbumService {

    @Autowired
    private AlbumDao albumDao;

    @Override
    public String test() {

        String res = "";
        Album album = null;
        try {
            Long id = 1L;
            album = albumDao.selectByPrimaryKey(id);
        } catch (Exception e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
        }

        if(album == null){
            Integer test = albumDao.test();

            return  String.valueOf(test);

        }


        return album.toString();
    }
}
